package behavioral.mediator;

/**
 * @Description: 用户
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class Colleague {
    AbstractMediator mediator;
    private String name;

    public Colleague(String name) {
        this.name = name;
    }

    public void setMediator(AbstractMediator mediator) {
        this.mediator = mediator;
    }

    public void sendMessage() {
        System.out.println(String.format("【%s】发送了信息", name));
        mediator.sendMessage();
    }

    public void receiveMessage() {
        System.out.println(String.format("【%s】接收了信息", name));
    }
}
